package com.isoftstone.common.dao;

import com.isoftstone.common.Page;
import com.isoftstone.common.entity.SysRole;
import com.isoftstone.common.entity.SysUser;
import com.isoftstone.util.PageData;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface SysUserMapper {


    SysUser getUserByUserName(@Param("userName") String userName) throws Exception;

    SysUser getUserDeptById(@Param("userId") String userId)throws Exception;

    List<SysUser> getUserlistPage(Page page) throws Exception;

    List<SysUser> getBankUserlistPage(Page page) throws Exception;

    //显示登录用户信息
    SysUser getShowUser(@Param("userName") String userName) throws Exception;

    Integer getUserRetryCount(@Param("userName") String userName)throws Exception;


    /**
     * 保存登录IP
     * @param user
     * @throws Exception
     */
    void saveUserIP(SysUser user)throws Exception;

    /**保存用户
     * @param user
     * @throws Exception
     */
    void saveUser(SysUser user)throws Exception;


    /**修改用户
     * @param user
     * @throws Exception
     */
    void updateUser(SysUser user)throws Exception;

    /**批量删除用户
     * @param userIds
     * @throws Exception
     */
    void deleteAllU(@Param("userIds") String[] userIds)throws Exception;

    void updateRetryCount(@Param("userName") String userName, @Param("retryCount") Integer retryCount);

    /*
    * 根据商户编号，system、员工编号查看
    * */
    SysUser getSysUserByCorpIdAndUserId(@Param("corpId") String corpId,@Param("userid") String userid) throws Exception;

    String getuserIdByuserId(@Param("userid") String userid)throws Exception;

    String getnumber() throws Exception;

    SysUser getUserById(String userid) throws Exception;

    SysUser  getUserByRoleId(@Param("roleId") String roleId)throws Exception;

    void deleteSysUserbyUserId(@Param("userid") String userid) throws Exception;

    int countUserByCorpId(@Param("corpId") String corpId);

    void deleteSysUserbyUserIdandCorpId(@Param("userid") String userid, @Param("corpId") String corpId)throws Exception;

    SysUser getBankUserByUsercode(@Param("usercode") String usercode);

    int updateUserStatus(@Param("usercode")String usercode, @Param("status")String status);

    String[] getMerchantUserListByCorpIds(PageData pd);

    String[] getFeeUserListByCorpIds(PageData pd);

    String getUserCodeByUserCode(@Param("userCode") String userCode)throws Exception;

    String getStatusBycomUserCode(@Param("userCode") String userCode)throws Exception;

    List<SysUser> getallUser()throws Exception;
}